<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
  <meta name="generator" content=
  "HTML Tidy for Linux/x86 (vers 1 September 2005), see www.w3.org">

  <title>fread</title>
  <link href="../cppreference.css" rel="stylesheet" type="text/css">
</head>

<body>
<table>
  <tr>
  <td>
  <div class="body-content">

  <div class="header-box">
    <a href="../index.html">cppreference.com</a> &gt; <a href=
    "index.html">Standard C I/O</a> &gt; <a href="fread.html">fread</a>
  </div>

  <div class="name-format">
    fread
  </div>

  <div class="syntax-name-format">
    Syntax:
  </div>
  <pre class="syntax-box">
  #include &lt;stdio.h&gt;
  int fread( void *buffer, size_t size, size_t num, FILE *stream );
</pre>

  <p>The function fread() reads <em>num</em> number of objects (where
  each object is <em>size</em> bytes) and places them into the array
  pointed to by buffer. The data comes from the given input
  <em>stream</em>. The return value of the function is the number of
  things read. You can use <a href="feof.html">feof</a>() or <a href=
  "ferror.html">ferror</a>() to figure out if an error occurs.</p>

  <div class="related-name-format">
    Related topics:
  </div>

  <div class="related-content">
    <a href="fflush.html">fflush</a><br>
    <a href="fgetc.html">fgetc</a><br>
    <a href="fopen.html">fopen</a><br>
    <a href="fputc.html">fputc</a><br>
    <a href="fscanf.html">fscanf</a><br>
    <a href="fwrite.html">fwrite</a><br>
    <a href="getc.html">getc</a>
  </div>
  </div>
  </td>
  


  </tr>
  </table>
</body></html>
